<template>
	<view class="abc">
		<view class="content">
			<view>
				<image class='content_img' :src="myImg" alt=""></image>
					<view class="content_name">
						<text
							style="display:block;font-size: 40rpx;margin: 15rpx 0;">{{$store.state.userInfo.nick_name}}</text>
						<text style="font-size: 25rpx;">{{$store.state.userInfo.user_name}}</text>
					</view>
			</view>
			<view class="checkMode">
				<view class='my_task' style="border-right: 1px #EFEFF5 solid;">
					<text class="my_task_num">{{taskList.alreadyInspCount}}</text>
					<text style="display:block">已检查</text>
				</view>
				<view class='my_task'>
					<text class="my_task_num">{{taskList.awaitInspCount}}</text>
					<text style="display:block">待检查</text>
				</view>
			</view>
			<view class="my_material">
				<text style="font-size:40rpx;width: 100%;padding: 30rpx;display: inline-block;">我的资料</text>
				<view style="padding: 30rpx;">
					<text style="color: #666666;float: left;">我的姓名</text>
					<text style="float: right;">{{$store.state.userInfo.real_name}}</text>
					<view style="clear:both;"></view>
				</view>
				<view style="padding: 30rpx;">
					<text style="color: #666666;float: left;">所属机构</text>
					<text style="float: right;">{{deptName.length==0?'无':deptName[0].title}}</text>
					<view style="clear:both;"></view>
				</view>
				<view style="padding: 30rpx;">
					<text style="color: #666666;float: left;">关于</text>
					<text style="float: right;color:#0D91FF" @click='regard'>>></text>
					<view style="clear:both;"></view>
				</view>
				<view style="padding: 30rpx;">
					<text style="color: #666666;float: left;">退出</text>
					<text style="float: right;color:#0D91FF" @click='exit'>>></text>
					<view style="clear:both;"></view>
				</view>
				<!-- <view style="padding: 30rpx;">
				<text style="color: #666666;float: left;">所属部门</text>
				<text style="float: right;">早早</text>
				<view style="clear:both;"></view>
			</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	import * as api from '@/common/api/notice.js'
	// import indexBackgroundImage from '/static/my/my.png'
	import myImg from "/static/my/photo.png"
	export default {
		data() {
			return {
				taskList: [],
				deptName: [{
					title: ""
				}],
				myImg: myImg,
				// indexBackgroundImage: indexBackgroundImage

			}
		},
		mounted() {
			// 已检查/待检查/待审核/已审核
			api.default.getTaskStatistics().then(res => {
				this.taskList = res.data.data
			})
			//部门查询
			this.$api.getDeptTreeById(this.$store.state.userInfo.dept_id).then(res => {
				this.deptName = res.data.data

			})
		},
		methods: {
			regard() {
				this.$goBack('./regard', 2);
			},
			//退出登录
			exit() {
				this.$store.commit('logOut');
				this.$goBack('../login/login', 4)
			}
		},
	}
</script>
<style>
	page {
		width: 100%;
		height: 80%;
		background: url('~/static/my/my.png') no-repeat;
		background-size: cover;
	}
</style>
<style lang="scss" scoped>
	.content {
		width: 93%;
		padding: 25rpx;
		position: absolute;
		top: 10%;

		.content_img {
			width: 150rpx;
			height: 150rpx;
			// display: inline-block;
			vertical-align: middle;
		}

		.content_name {
			display: inline-block;
			margin: 0 0 0 30rpx;
			vertical-align: middle;
		}

		.checkMode {
			display: flex;
			justify-content: space-evenly;
			margin: 50rpx 0;
			border-radius: 10px;
			// padding: 30rpx 0 ;
			background-color: white;

			// 检查/待检查
			.my_task {
				width: 50%;
				text-align: center;
				display: inline-block;
				padding: 10rpx 0;

				.my_task_num {
					display: block;
					margin: 10rpx 0;
					font-size: 35rpx;
				}
			}
		}



		.my_material {
			width: 100%;
			height: 800rpx;
			border-radius: 15px;
			// background-color: rgb(255, 255, 255, 0.6);
			background-color: white;
		}

	}
</style>
